<?php
/**
 * 小区模型
 */

namespace app\badmin\model;


use app\common\lib\RespCode;
use app\common\model\BaseModel;
use custom\Err;
use map\BaiDu;
use PDOStatement;
use think\Collection;
use think\Db;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\Exception;
use think\exception\DbException;
use think\exception\PDOException;
use think\Model;

class HouseVillage extends BaseModel {

    /**
     * 筛选多条
     * @param array|null $map
     * @param $column
     * @return array|PDOStatement|string|Collection
     * @throws DataNotFoundException
     * @throws ModelNotFoundException
     * @throws DbException
     */
    public static function getDatas(?array $map, $column) {
        return db('house_village')
            ->where($map)
            ->field($column)
            ->select();
    }

    /**
     * 筛选单条
     * @param array|null $map
     * @param $column
     * @return array|PDOStatement|string|Model|null
     * @throws DataNotFoundException
     * @throws ModelNotFoundException
     * @throws DbException
     */
    public static function getOne(?array $map, $column) {
        return Db::name('house_village')
            ->where($map)
            ->field($column)
            ->find();
    }

}
